//
//  PairTestViewController.m
//  PairTest
//
//  Created by Carlos Rodriguez Dominguez on 13/04/09.
//  Copyright __MyCompanyName__ 2009. All rights reserved.
//

#import "PairTestViewController.h"
#import "collaborationSubsystem.h"
#import "TestingCollaboration.h"

@implementation PairTestViewController

-(IBAction) sendEvent:(id)sender
{
	float x = [[text1 text] floatValue];
	float y = [[text2 text] floatValue];
	[dobj changeValue:x and:y];
}

-(UITextField*) label 
{
	return label;
}


// The designated initializer. Override to perform setup that is required before the view is loaded.
/*- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
	
    }
    return self;
}*/


/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/



// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
	//creacion de un objecto de test para probar el envio y reception de eventos
	
	dobj = [[TestObject alloc] initWithHandler:[collaborationSubsystem eventHandler]];
	TestListener* listener = [[TestListener alloc] initWithController:self];
	[dobj addEventListener:listener];
	
	[[collaborationSubsystem eventHandler] registerObject:dobj];
	
    [super viewDidLoad];
}



/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}


- (void)dealloc {
    [super dealloc];
}

@end
